package tech.aistar.service.adopt.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.adopt.AdoptCat;
import tech.aistar.mapper.adopt.AdoptCatMapper;
import tech.aistar.service.adopt.IAdoptCatService;

import java.util.List;

/**
 * Created by 陆锦鹏 on 2019/9/24.
 */
@Service
@Transactional
public class AdoptCatServiceImpl implements IAdoptCatService {

    @Autowired
    private AdoptCatMapper adoptCatMapper;


    @Override
    public List<AdoptCat> findAll() {

        List<AdoptCat> adoptCats = adoptCatMapper.findAll();

        return adoptCats;
    }

    @Override
    public AdoptCat findOneById(Integer id) {

        AdoptCat adoptCat = adoptCatMapper.findOneById(id);

        return adoptCat;
    }

    @Override
    public void delById(Integer id) {
        adoptCatMapper.delById(id);
    }

    @Override
    public void save(AdoptCat adoptCat) {
        adoptCatMapper.save(adoptCat);
    }

    @Override
    public void update(AdoptCat adoptCat) {
        adoptCatMapper.update(adoptCat);
    }
}
